package zut.cs.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import zut.cs.daomain.Student;

import java.util.List;

@Repository
public interface StudentDao {

    @Select("select * from stu")
    List<Student> findAll();

    @Insert("insert into stu(number,name,sex,result) values (#{number},#{name},#{sex},#{result})")
    void insert(Student student);

    @Update("update stu set level = (#{level}) where number=#{number}")
    void modifyLevel(Student student);
}
